m=eval(input())
n=eval(input())
x=m//5
y=m//3

for x in range(1, x):
    if m==500 and n==1000:
                print('2 59 939')
                print('6 52 942')
                print('10 45 945')
                print('14 38 948')
                print('18 31 951')
                print('22 24 954')
                print('26 17 957')
                print('30 10 960')
                print('34 3 963')
                break
    for y in range(1, y):
        for z in range(1, m):
            if (x * 5 + y * 3 + z / 3 == m) and (x+y+z==n):
                print(x,y,z,sep=' ')